package com.helmlabs.grouper.cms.model;

import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.hibernate.annotations.CollectionOfElements;

@Entity
@Table(name="layout_regional")
@PrimaryKeyJoinColumn(name="layout_id")
public class RegionalLayout extends AbstractLayout {
	
	private Map<String, Region> regions;
	
	public String render(HttpServletRequest req, HttpServletResponse resp){
		return "";
	}

	@CollectionOfElements(fetch=FetchType.EAGER)
	@JoinTable(
			name="layout_regional_regions",
			joinColumns = @JoinColumn(name="regional_id"))
	@org.hibernate.annotations.MapKey(
			columns={
					@Column(name="region")
			}
	)
	public Map<String, Region> getRegions() {
		return regions;
	}

	public void setRegions(Map<String, Region> regions) {
		this.regions = regions;
	}	

}
